Starting animations with the Play Animation action
Use the Play Animation action to start an animation with all triggers that come with Kanzi. See Triggers.
To trigger an animation with the Play Animation action:
- Create an Animation Clip and the node you want to animate with that Animation Clip. See Creating keyframe animations.
- Create the node from which you want to trigger the animation and add a trigger to it. See Adding a trigger.
For example, to start an animation when Kanzi adds the node to the scene graph use On Attached trigger, or to start the animation when user interacts with your application, create a Button node and use the Button: Click trigger.
- In the Triggers click the drop-down menu, and select the Play Animation action.
The Message Editor opens.
- In the Message Editor > General tab set:
- Target Item to the node you want to animate.
For example, use <Relative> and .
for the path to animate the node that has the trigger. - Animation to the animation you want to use to animate your node.
For example, use an Animation Data item, an Animation Clip, or a Timeline Sequence if you use a more complex animation.
- In the Message Editor > Advanced tab set the animation playback settings:
- Playback Mode property defines how Kanzi plays the animation:
- Normal plays the animation as it is defined in the animation.
- Ping pong first plays the animation as it is defined in the animation and then plays the animation in reverse.
- Reverse plays the animation defined in the animation in reverse.
- Length Scale property defines the duration of the animation.
For example:- When set to 1, the animation is of the same length as it is defined in the animation.
- When set to 0,5, the animation is half as long as it is defined in the animation.
- When set to 2, the animation is twice as long as it is defined in the animation.
- Restore Original Values After Playback defines whether the values of the animated properties return to their initial values when the animation ends.
For example, if the initial value of a property you animate is 0 and at the end of the animation the value is 1, when you enable the Restore Original Values After Playback property, Kanzi returns the value of the animated property to 0 when the animation ends. - Action Delay (ms) sets the delay in milliseconds after which the animation starts playing.
See also
Animating a node for the duration of its lifetime
Changing the interpolation mode between keyframes
Creating animated controls
Editing animation clips
Editing timeline sequences
Creating keyframe animations
Creating animations and timelines using the Kanzi Engine API
Animations
Open topic with navigation